Optimal. Leaf size=194 \[ -\frac{2 i A (1-2 n) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n \text{Hypergeometric2F1}\left (\frac{1}{2},1-n,\frac{3}{2},-i \tan (c+d x)\right )}{d \sqrt{\cot (c+d x)}}+\frac{2 (B+i A) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n F_1\left (\frac{1}{2};1-n,1;\frac{3}{2};-i \tan (c+d x),i \tan (c+d x)\right )}{d \sqrt{\cot (c+d x)}}-\frac{2 A \sqrt{\cot (c+d x)} (a+i a \tan (c+d x))^n}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.5934, antiderivative size = 194, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 10, integrand size = 36, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.278, Rules used = {4241, 3598, 3601, 3564, 130, 430, 429, 3599, 66, 64} \[ \frac{2 (B+i A) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n F_1\left (\frac{1}{2};1-n,1;\frac{3}{2};-i \tan (c+d x),i \tan (c+d x)\right )}{d \sqrt{\cot (c+d x)}}-\frac{2 i A (1-2 n) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n \, _2F_1\left (\frac{1}{2},1-n;\frac{3}{2};-i \tan (c+d x)\right )}{d \sqrt{\cot (c+d x)}}-\frac{2 A \sqrt{\cot (c+d x)} (a+i a \tan (c+d x))^n}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4241
Rule 3598
Rule 3601
Rule 3564
Rule 130
Rule 430
Rule 429
Rule 3599
Rule 66
Rule 64
Rubi steps
\begin{align*} \int \cot ^{\frac{3}{2}}(c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx &=\left (\sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \int \frac{(a+i a \tan (c+d x))^n (A+B \tan (c+d x))}{\tan ^{\frac{3}{2}}(c+d x)} \, dx\\ &=-\frac{2 A \sqrt{\cot (c+d x)} (a+i a \tan (c+d x))^n}{d}+\frac{\left (2 \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \int \frac{(a+i a \tan (c+d x))^n \left (\frac{1}{2} a (B+2 i A n)-\frac{1}{2} a A (1-2 n) \tan (c+d x)\right )}{\sqrt{\tan (c+d x)}} \, dx}{a}\\ &=-\frac{2 A \sqrt{\cot (c+d x)} (a+i a \tan (c+d x))^n}{d}+\left ((i A+B) \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \int \frac{(a+i a \tan (c+d x))^n}{\sqrt{\tan (c+d x)}} \, dx-\frac{\left (i A (1-2 n) \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \int \frac{(a-i a \tan (c+d x)) (a+i a \tan (c+d x))^n}{\sqrt{\tan (c+d x)}} \, dx}{a}\\ &=-\frac{2 A \sqrt{\cot (c+d x)} (a+i a \tan (c+d x))^n}{d}+\frac{\left (i a^2 (i A+B) \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \operatorname{Subst}\left (\int \frac{(a+x)^{-1+n}}{\sqrt{-\frac{i x}{a}} \left (-a^2+a x\right )} \, dx,x,i a \tan (c+d x)\right )}{d}-\frac{\left (i a A (1-2 n) \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \operatorname{Subst}\left (\int \frac{(a+i a x)^{-1+n}}{\sqrt{x}} \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac{2 A \sqrt{\cot (c+d x)} (a+i a \tan (c+d x))^n}{d}-\frac{\left (2 a^3 (i A+B) \sqrt{\cot (c+d x)} \sqrt{\tan (c+d x)}\right ) \operatorname{Subst}\left (\int \frac{\left (a+i a x^2\right )^{-1+n}}{-a^2+i a^2 x^2} \, dx,x,\sqrt{\tan (c+d x)}\right )}{d}-\frac{\left (i A (1-2 n) \sqrt{\cot (c+d x)} (1+i \tan (c+d x))^{-n} \sqrt{\tan (c+d x)} (a+i a \tan (c+d x))^n\right ) \operatorname{Subst}\left (\int \frac{(1+i x)^{-1+n}}{\sqrt{x}} \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac{2 A \sqrt{\cot (c+d x)} (a+i a \tan (c+d x))^n}{d}-\frac{2 i A (1-2 n) \, _2F_1\left (\frac{1}{2},1-n;\frac{3}{2};-i \tan (c+d x)\right ) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n}{d \sqrt{\cot (c+d x)}}-\frac{\left (2 a^2 (i A+B) \sqrt{\cot (c+d x)} (1+i \tan (c+d x))^{-n} \sqrt{\tan (c+d x)} (a+i a \tan (c+d x))^n\right ) \operatorname{Subst}\left (\int \frac{\left (1+i x^2\right )^{-1+n}}{-a^2+i a^2 x^2} \, dx,x,\sqrt{\tan (c+d x)}\right )}{d}\\ &=-\frac{2 A \sqrt{\cot (c+d x)} (a+i a \tan (c+d x))^n}{d}+\frac{2 (i A+B) F_1\left (\frac{1}{2};1-n,1;\frac{3}{2};-i \tan (c+d x),i \tan (c+d x)\right ) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n}{d \sqrt{\cot (c+d x)}}-\frac{2 i A (1-2 n) \, _2F_1\left (\frac{1}{2},1-n;\frac{3}{2};-i \tan (c+d x)\right ) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n}{d \sqrt{\cot (c+d x)}}\\ \end{align*}
Mathematica [F] time = 28.1499, size = 0, normalized size = 0. \[ \int \cot ^{\frac{3}{2}}(c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.38, size = 0, normalized size = 0. \begin{align*} \int \left ( \cot \left ( dx+c \right ) \right ) ^{{\frac{3}{2}}} \left ( a+ia\tan \left ( dx+c \right ) \right ) ^{n} \left ( A+B\tan \left ( dx+c \right ) \right ) \, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \tan \left (d x + c\right ) + A\right )}{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{\frac{3}{2}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{{\left ({\left (i \, A + B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, A - B\right )} \left (\frac{2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n} \sqrt{\frac{i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \tan \left (d x + c\right ) + A\right )}{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{\frac{3}{2}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]